package com.nickstumpos.android.GmailWidgetPlus.widget.presentation.managers.displaylabels.fourbyone;

import java.util.List;

import android.content.Context;
import android.util.Log;

import com.nickstumpos.android.GmailWidgetPlus.labels.LabelCountPair;
import com.nickstumpos.android.GmailWidgetPlus.widget.presentation.managers.WidgetUIData;
import com.nickstumpos.android.GmailWidgetPlus.widget.presentation.managers.displaylabels.AWidgetWithLabelsUIManager;
import com.nickstumpos.android.GmailWidgetPlus.widget.sizes.WidgetSize;

public abstract class FourByOneWidgetUIManager extends
		AWidgetWithLabelsUIManager {

	public FourByOneWidgetUIManager(final Context context,
			final WidgetUIData wData) {
		super(context, wData);

	}

	protected void changeToStateIsUnread() {
		this.showUnreadButton();
		this.hideNoMailButton();
		this.displayLabelsWithUnreadMail();
	}

	protected void changeToStateNoAccount() {
		this.showDisabledMessage();
		this.hideAllLabels();
		this.hideUnreadButton();
	}

	protected void changeToStateNoUnread() {
		this.showUnreadButton();
		this.setArrowButtonStates();
		this.showNoMailButton();
		this.hideAllLabels();
	}

	@Override
	protected WidgetSize getWidgetSize() {
		return WidgetSize.FOURxONE;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * com.nickstumpos.android.GmailWidgetPlus.widget.presentation.managers.
	 * WidgetUIManager#updateWidget(java.util.List, int, boolean)
	 */
	@Override
	public void updateWidget(final List<LabelCountPair> labels,
			final int unreadCount,
			final boolean haveAccount) {
		this.refreshLabelsAndCounts(labels);
		Log.i("GMWP", "updating Widget: " + this.getWidgetId());
		this.setHaveAccount(haveAccount);
		this.updateUnreadCount(unreadCount);
		this.loadChange();
	}
}
